package com.qf.api.fallback;

import com.qf.api.feign.PointFeign;
import com.qf.common.core.common.R;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * --- 天道酬勤 ---
 *
 * @author QiuShiju
 * @date 2025/11/10
 * @desc
 */
@Component
public class PointFeignFallbackFactory  implements FallbackFactory<PointFeign> {
    @Override
    public PointFeign create(Throwable cause) {
        return new PointFeign() {
            @Override
            public R addPoint(Integer uid, Integer pointType) {
                cause.printStackTrace();
                return R.fail(cause.getMessage());
            }
        };
    }
}
